Optimal. Leaf size=47 \[ \frac {b^2 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {2 a b \cos (c+d x)}{d}+\frac {\left (a^2-b^2\right ) \sin (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 47, normalized size of antiderivative = 1.00, number of steps
used = 1, number of rules used = 1, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.053, Rules used = {3588}
\begin {gather*} \frac {\left (a^2-b^2\right ) \sin (c+d x)}{d}-\frac {2 a b \cos (c+d x)}{d}+\frac {b^2 \tanh ^{-1}(\sin (c+d x))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3588
Rubi steps
\begin {align*} \int \cos (c+d x) (a+b \tan (c+d x))^2 \, dx &=\frac {b^2 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {2 a b \cos (c+d x)}{d}+\frac {\left (a^2-b^2\right ) \sin (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.16, size = 84, normalized size = 1.79 \begin {gather*} \frac {-2 a b \cos (c+d x)+b^2 \left (-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+\left (a^2-b^2\right ) \sin (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.20, size = 53, normalized size = 1.13
method | result | size |
derivativedivides | \(\frac {b^{2} \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-2 \cos \left (d x +c \right ) a b +a^{2} \sin \left (d x +c \right )}{d}\) | \(53\) |
default | \(\frac {b^{2} \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-2 \cos \left (d x +c \right ) a b +a^{2} \sin \left (d x +c \right )}{d}\) | \(53\) |
risch | \(-\frac {{\mathrm e}^{i \left (d x +c \right )} a b}{d}-\frac {i a^{2} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i {\mathrm e}^{i \left (d x +c \right )} b^{2}}{2 d}-\frac {{\mathrm e}^{-i \left (d x +c \right )} a b}{d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} a^{2}}{2 d}-\frac {i {\mathrm e}^{-i \left (d x +c \right )} b^{2}}{2 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{2}}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{2}}{d}\) | \(147\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 60, normalized size = 1.28 \begin {gather*} \frac {b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right ) - 2 \, \sin \left (d x + c\right )\right )} - 4 \, a b \cos \left (d x + c\right ) + 2 \, a^{2} \sin \left (d x + c\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 62, normalized size = 1.32 \begin {gather*} -\frac {4 \, a b \cos \left (d x + c\right ) - b^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) + b^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \tan {\left (c + d x \right )}\right )^{2} \cos {\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 1316 vs.
\(2 (47) = 94\).
time = 0.81, size = 1316, normalized size = 28.00 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.89, size = 66, normalized size = 1.40 \begin {gather*} \frac {2\,b^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {4\,a\,b-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,a^2-2\,b^2\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________